setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
load('CheackPointOne.RData')

Tercera Clasificacion: pEhExvsEhMyb10

head(pEhExvsEhMyb10,10);
##          GenId    CDC5_1    CDC5_2       CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1  EHI_000130A  69.92805  61.19384   501.737159 139.50869  345.55778  365.63668
## 2  EHI_000140A 216.05975  28.79710    65.853002 281.38193  272.31456   29.64622
## 3  EHI_000240A 850.79131 488.65084 12364.685110 936.36340 1543.74183 1622.30687
## 4  EHI_000250A 413.29272 616.43798  1843.884059 258.91867  261.04637  503.43668
## 5  EHI_000260A  81.58273  77.39221   517.416445  86.89736   53.52390   38.43028
## 6  EHI_000280A  35.86054  48.59511    59.581288  43.74425   66.67012   47.21435
## 7  EHI_000290A  12.55119  23.39765    47.037859  14.77846   11.26819   62.03745
## 8  EHI_000300A 103.99557  68.39312     9.407572 106.40493   92.02354   24.15618
## 9  EHI_000410A  17.03376  10.79891   144.249433  22.46326   19.71933   49.95937
## 10 EHI_000430A  18.82678  19.79801    25.086858  20.68985   11.26819    8.23506
nbreaks <- 10
data3 <- pEhExvsEhMyb10;       head(data3)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  69.92805  61.19384   501.73716 139.50869  345.55778  365.63668
## 2 EHI_000140A 216.05975  28.79710    65.85300 281.38193  272.31456   29.64622
## 3 EHI_000240A 850.79131 488.65084 12364.68511 936.36340 1543.74183 1622.30687
## 4 EHI_000250A 413.29272 616.43798  1843.88406 258.91867  261.04637  503.43668
## 5 EHI_000260A  81.58273  77.39221   517.41645  86.89736   53.52390   38.43028
## 6 EHI_000280A  35.86054  48.59511    59.58129  43.74425   66.67012   47.21435

Log-NormalizaciĂ³n

sample1   <- data3$pEhEx_1; sample2   <- data3$pEhEx_2; sample3   <- data3$pEhEx_3;
samplevs1 <- data3$CDC5_1;  samplevs2 <- data3$CDC5_2;  samplevs3 <- data3$CDC5_3;
log2sample1 <- log2(sample1+1);         log2sample2 <- log2(sample2+1)
log2sample3 <- log2(sample3+1);         log2samplevsCDC51 <- log2(samplevs1+1)
log2samplevsCDC52 <- log2(samplevs2+1); log2samplevsCDC53 <- log2(samplevs3+1)
data3 <- cbind(data3, log2sample1,log2sample2,log2sample3,
               log2samplevsCDC51,log2samplevsCDC52,log2samplevsCDC53)
head(data3)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  69.92805  61.19384   501.73716 139.50869  345.55778  365.63668
## 2 EHI_000140A 216.05975  28.79710    65.85300 281.38193  272.31456   29.64622
## 3 EHI_000240A 850.79131 488.65084 12364.68511 936.36340 1543.74183 1622.30687
## 4 EHI_000250A 413.29272 616.43798  1843.88406 258.91867  261.04637  503.43668
## 5 EHI_000260A  81.58273  77.39221   517.41645  86.89736   53.52390   38.43028
## 6 EHI_000280A  35.86054  48.59511    59.58129  43.74425   66.67012   47.21435
##   log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1    7.134516    8.436952    8.518207          6.148284          5.958700
## 2    8.141504    8.094418    4.937637          7.761948          4.897100
## 3    9.872465   10.593150   10.664720          9.734356          8.935610
## 4    8.021916    8.033678    8.978529          8.694507          9.270150
## 5    6.457748    5.768817    5.301232          6.367768          6.292638
## 6    5.483630    6.080447    5.591391          5.204005          5.632126
##   log2samplevsCDC53
## 1          8.973661
## 2          6.062920
## 3         13.594055
## 4         10.849314
## 5          9.017968
## 6          5.920800
save.image('CheckPointFour.RData')
setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
#load('CheckPointTwo.RData')
library(ggplot2);library(dplyr);library("fitdistrplus");
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
## Loading required package: survival
library("MASS");library("survival")
head(data3)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  69.92805  61.19384   501.73716 139.50869  345.55778  365.63668
## 2 EHI_000140A 216.05975  28.79710    65.85300 281.38193  272.31456   29.64622
## 3 EHI_000240A 850.79131 488.65084 12364.68511 936.36340 1543.74183 1622.30687
## 4 EHI_000250A 413.29272 616.43798  1843.88406 258.91867  261.04637  503.43668
## 5 EHI_000260A  81.58273  77.39221   517.41645  86.89736   53.52390   38.43028
## 6 EHI_000280A  35.86054  48.59511    59.58129  43.74425   66.67012   47.21435
##   log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1    7.134516    8.436952    8.518207          6.148284          5.958700
## 2    8.141504    8.094418    4.937637          7.761948          4.897100
## 3    9.872465   10.593150   10.664720          9.734356          8.935610
## 4    8.021916    8.033678    8.978529          8.694507          9.270150
## 5    6.457748    5.768817    5.301232          6.367768          6.292638
## 6    5.483630    6.080447    5.591391          5.204005          5.632126
##   log2samplevsCDC53
## 1          8.973661
## 2          6.062920
## 3         13.594055
## 4         10.849314
## 5          9.017968
## 6          5.920800

Muestra 1

log2sample1 <- data3$log2sample1; head(mean(log2sample1)); head(sd(log2sample1))
## [1] 6.089174
## [1] 2.844545
head(log2sample1,5)
## [1] 7.134516 8.141504 9.872465 8.021916 6.457748
summary(data3)
##     GenId               CDC5_1              CDC5_2             CDC5_3         
##  Length:4687        Min.   :     0.00   Min.   :     0.0   Min.   :      0.0  
##  Class :character   1st Qu.:    14.34   1st Qu.:    16.2   1st Qu.:     12.5  
##  Mode  :character   Median :    41.24   Median :    41.4   Median :     50.2  
##                     Mean   :  1568.76   Mean   :  1496.5   Mean   :   4142.0  
##                     3rd Qu.:   189.61   3rd Qu.:   167.4   3rd Qu.:    239.9  
##                     Max.   :247688.75   Max.   :404961.1   Max.   :2325768.1  
##     pEhEx_1             pEhEx_2             pEhEx_3          log2sample1    
##  Min.   :     0.00   Min.   :     0.00   Min.   :     0.0   Min.   : 0.000  
##  1st Qu.:    15.37   1st Qu.:    14.09   1st Qu.:    12.6   1st Qu.: 4.033  
##  Median :    43.15   Median :    44.13   Median :    43.9   Median : 5.464  
##  Mean   :  1165.87   Mean   :  1467.37   Mean   :  1522.5   Mean   : 6.089  
##  3rd Qu.:   176.16   3rd Qu.:   194.38   3rd Qu.:   193.2   3rd Qu.: 7.469  
##  Max.   :170161.59   Max.   :223245.35   Max.   :553907.7   Max.   :17.377  
##   log2sample2      log2sample3     log2samplevsCDC51 log2samplevsCDC52
##  Min.   : 0.000   Min.   : 0.000   Min.   : 0.000    Min.   : 0.000   
##  1st Qu.: 3.915   1st Qu.: 3.768   1st Qu.: 3.940    1st Qu.: 4.104   
##  Median : 5.496   Median : 5.489   Median : 5.401    Median : 5.406   
##  Mean   : 6.054   Mean   : 5.945   Mean   : 6.079    Mean   : 6.086   
##  3rd Qu.: 7.610   3rd Qu.: 7.602   3rd Qu.: 7.574    3rd Qu.: 7.396   
##  Max.   :17.768   Max.   :19.079   Max.   :17.918    Max.   :18.627   
##  log2samplevsCDC53
##  Min.   : 0.000   
##  1st Qu.: 3.760   
##  Median : 5.677   
##  Mean   : 6.068   
##  3rd Qu.: 7.912   
##  Max.   :21.149
ndata3    <- length(log2sample1)
hist(log2sample1, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample1')

meanlog2sample1 <- mean(log2sample1); head(meanlog2sample1)
## [1] 6.089174
StdDevlog2sample1 <- sd(log2sample1); head(StdDevlog2sample1)
## [1] 2.844545
Normlog2sample1 <- (log2sample1-meanlog2sample1)/StdDevlog2sample1; head(Normlog2sample1)
## [1]  0.3674899  0.7214968  1.3300161  0.6794558  0.1295722 -0.2128788
tst<- Normlog2sample1

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 3.587875e-17 0.01460516
## sd   9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##               mean            sd
## mean  1.000000e+00 -3.429538e-11
## sd   -3.429538e-11  1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293

CĂ¡lculo de cuantiles

CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8467216 0.8152581
## 70 -0.9222155 0.9595311
## 75 -0.9796121 1.1276277
## 80 -1.0443431 1.3803954
## 85 -1.0800958 1.7000005
## 90 -1.1601851 2.1830409
## 95 -1.3725612 2.6106296
## 99 -1.7448623 3.1766074
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra 2

log2sample2 <- data3$log2sample2; head(mean(log2sample2)); head(sd(log2sample2))
## [1] 6.054099
## [1] 3.081702
head(log2sample2,5)
## [1]  8.436952  8.094418 10.593150  8.033678  5.768817
ndata3    <- length(log2sample2)
hist(log2sample2, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample2')

Log-normalizacion

meanlog2sample2 <- mean(log2sample2); head(meanlog2sample2)
## [1] 6.054099
StdDevlog2sample2 <- sd(log2sample2); head(StdDevlog2sample2)
## [1] 3.081702
Normlog2sample2 <- (log2sample2-meanlog2sample2)/StdDevlog2sample2; head(Normlog2sample2)
## [1]  0.773226200  0.662075403  1.472903852  0.642365454 -0.092573117
## [6]  0.008549646
tst<- Normlog2sample2
hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajuste de modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 1.403180e-16 0.01460516
## sd   9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##              mean           sd
## mean 1.000000e+00 3.429538e-11
## sd   3.429538e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]

print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8686609 0.8470080
## 70 -0.9130056 0.9828038
## 75 -0.9619944 1.1403896
## 80 -1.0786897 1.3709267
## 85 -1.1501384 1.7083438
## 90 -1.2344905 2.1268598
## 95 -1.4696481 2.5248146
## 99 -1.9645312 3.0956436
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra 3

log2sample3 <- data3$log2sample3; head(mean(log2sample3)); head(sd(log2sample3))
## [1] 5.944632
## [1] 3.109086
head(log2sample3,5)
## [1]  8.518207  4.937637 10.664720  8.978529  5.301232
ndata3    <- length(log2sample3)
hist(log2sample3, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample2')

meanlog2sample3 <- mean(log2sample3); head(meanlog2sample3)
## [1] 5.944632
StdDevlog2sample3 <- sd(log2sample3); head(StdDevlog2sample3)
## [1] 3.109086
Normlog2sample3 <- (log2sample3-meanlog2sample3)/StdDevlog2sample3; head(Normlog2sample3)
## [1]  0.8277593 -0.3238879  1.5181592  0.9758164 -0.2069419 -0.1136159
tst<- Normlog2sample3
hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando Modelos

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -1.038159e-17 0.01460516
## sd    9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##              mean           sd
## mean 1.000000e+00 1.714769e-11
## sd   1.714769e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf   LimSup
## 65 -0.8804873 0.835306
## 70 -0.9392233 0.967202
## 75 -1.0441669 1.113353
## 80 -1.1800004 1.329308
## 85 -1.2993075 1.626575
## 90 -1.3728657 2.029023
## 95 -1.5681818 2.501518
## 99 -1.9120192 3.109798

CreaciĂ³n de histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC51

log2vsCDC51 <- data3$log2samplevsCDC51; head(mean(log2vsCDC51)); head(sd(log2vsCDC51))
## [1] 6.079067
## [1] 3.007873
head(log2vsCDC51,5)
## [1] 6.148284 7.761948 9.734356 8.694507 6.367768
ndata3    <- length(log2vsCDC51)
hist(log2vsCDC51, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC51')

meanlog2vsCDC51 <- mean(log2vsCDC51); head(meanlog2vsCDC51)
## [1] 6.079067
StdDevlog2vsCDC51 <- sd(log2vsCDC51); head(StdDevlog2vsCDC51)
## [1] 3.007873
Normlog2vsCDC51 <- (log2vsCDC51-meanlog2vsCDC51)/StdDevlog2vsCDC51; head(Normlog2vsCDC51)
## [1]  0.02301208  0.55949211  1.21524037  0.86953116  0.09598182 -0.29092372
tst<- Normlog2vsCDC51

Primer histograma

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC51',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 3.734449e-17 0.01460516
## sd   9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##               mean            sd
## mean  1.000000e+00 -3.429538e-11
## sd   -3.429538e-11  1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8769970 0.8328201
## 70 -0.9183158 0.9594611
## 75 -0.9635325 1.1254243
## 80 -1.0134598 1.3759593
## 85 -1.0691946 1.6825955
## 90 -1.2049095 2.1281103
## 95 -1.3948811 2.6187546
## 99 -2.0210515 3.1616174

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC52

log2vsCDC52 <- data3$log2samplevsCDC52; head(mean(log2vsCDC52)); head(sd(log2vsCDC52))
## [1] 6.08571
## [1] 2.815509
head(log2vsCDC52,5)
## [1] 5.958700 4.897100 8.935610 9.270150 6.292638

Primer Histograma

ndata3    <- length(log2vsCDC52)
hist(log2vsCDC52, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC52')

meanlog2vsCDC52 <- mean(log2vsCDC52); head(meanlog2vsCDC52)
## [1] 6.08571
StdDevlog2vsCDC52 <- sd(log2vsCDC52); head(StdDevlog2vsCDC52)
## [1] 2.815509
Normlog2vsCDC52 <- (log2vsCDC52-meanlog2vsCDC52)/StdDevlog2vsCDC52; head(Normlog2vsCDC52)
## [1] -0.04511077 -0.42216506  1.01221485  1.13103560  0.07349607 -0.16110183
tst<- Normlog2vsCDC52

** Segundo Histograma**

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC52',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 7.844575e-18 0.01460516
## sd   9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##      mean sd
## mean    1  0
## sd      0  1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

CĂ¡lculo de cuantiles

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8241172 0.7977969
## 70 -0.8968636 0.9352333
## 75 -0.9375162 1.0847564
## 80 -0.9816741 1.3463833
## 85 -1.0299993 1.6629255
## 90 -1.0833612 2.1783677
## 95 -1.2880076 2.7298034
## 99 -2.1614954 3.4267131

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC53

log2vsCDC53 <- data3$log2samplevsCDC53; head(mean(log2vsCDC53)); head(sd(log2vsCDC53))
## [1] 6.068265
## [1] 3.43608
head(log2vsCDC53,5)
## [1]  8.973661  6.062920 13.594055 10.849314  9.017968
ndata3    <- length(log2vsCDC53)

** Primer histograma**

hist(log2vsCDC53, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC53')

meanlog2vsCDC53 <- mean(log2vsCDC53); head(meanlog2vsCDC53)
## [1] 6.068265
StdDevlog2vsCDC53 <- sd(log2vsCDC53); head(StdDevlog2vsCDC53)
## [1] 3.43608
Normlog2vsCDC53 <- (log2vsCDC53-meanlog2vsCDC53)/StdDevlog2vsCDC53; head(Normlog2vsCDC53)
## [1]  0.845555235 -0.001555479  2.190225383  1.391425525  0.858449916
## [6] -0.042916597
tst<- Normlog2vsCDC53

Segundo histograma

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC53',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -1.107054e-16 0.01460516
## sd    9.998933e-01 0.01032736
## Loglikelihood:  -6650.065   AIC:  13304.13   BIC:  13317.03 
## Correlation matrix:
##              mean           sd
## mean 1.000000e+00 1.714769e-11
## sd   1.714769e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

Calculo de cuantiles

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.7824916 0.8709604
## 70 -0.9330312 0.9884576
## 75 -1.1699608 1.1455636
## 80 -1.1699608 1.3353109
## 85 -1.1699608 1.5512574
## 90 -1.7660431 1.8682788
## 95 -1.7660431 2.3078117
## 99 -1.7660431 3.1171283

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))